fix(ci): use tree-hash anchor for accurate promotion commit list#1197
Merged
castrojo merged 1 commit intoublue-os:mainfrom Mar 17, 2026
Merged
Conversation
After a squash-merge promotion, git log origin/lts..origin/main lists every individual commit that was squash-merged (since lts only has one squash commit, not the individual ones). This caused the promotion PR body to bloat on every subsequent run. Fix by finding the most-recent commit on main whose tree hash matches the current lts tree — this is always the exact main commit that was squash-merged into lts. git log is then anchored from that point, showing only genuinely new commits regardless of squash-merge history. Also remove || true from gh pr edit so failures surface visibly, and add a guard to skip PR creation when lts is ahead/diverged from main with no commits to promote. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: Claude Sonnet 4.6 via GitHub Copilot
7d2f542 to
c6ff3da
Compare
Merged
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the main → lts promotion mechanism by replacing the manual workflow_dispatch-based squash-push workflow with an automated, human-gated draft PR flow, and refreshes the CI/CD documentation accordingly.
Changes:
- Document the PR-gated
main→ltspromotion flow and update release schedule references inAGENTS.md. - Remove the legacy
.github/workflows/promote-to-lts.ymlworkflow. - Add
.github/workflows/create-lts-pr.ymlto auto-create/update a draft PR frommaintoltswhen content differs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
AGENTS.md |
Updates the authoritative CI/CD reference to describe PR-gated promotion and the Tuesday release schedule. |
.github/workflows/promote-to-lts.yml |
Removes the old manual squash-push promotion workflow. |
.github/workflows/create-lts-pr.yml |
Adds automation to create/update the main → lts promotion PR and generate a promotion commit list. |
Comments suppressed due to low confidence (1)
.github/workflows/create-lts-pr.yml:81
gh pr list --head maincan match PRs from forks whose branch name is alsomain(since--headcan be ambiguous when not owner-qualified). To avoid accidentally editing the wrong PR, consider using an owner-qualified head ref (e.g.,${{ github.repository_owner }}:main) and passing-R ${{ github.repository }}consistently for theghcalls.
EXISTING=$(gh pr list \
--base lts \
--head main \
--state open \
--json number \
--jq '.[0].number' \
2>/dev/null || echo "")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
32
to
39
| if git diff --quiet origin/lts origin/main; then | ||
| echo "No content difference between lts and main. Nothing to promote." | ||
| echo "has_diff=false" >> "$GITHUB_OUTPUT" | ||
| elif [ -z "$(git log origin/lts..origin/main --oneline)" ]; then | ||
| echo "lts is ahead of or diverged from main with no commits to promote. Nothing to promote." | ||
| echo "has_diff=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "has_diff=true" >> "$GITHUB_OUTPUT" |
Comment on lines
+50
to
+57
| ANCHOR=$(git log origin/main --format="%H %T" --max-count=500 \ | ||
| | awk -v t="$LTS_TREE" '$2==t{print $1; exit}') | ||
|
|
||
| if [ -n "$ANCHOR" ]; then | ||
| LIST=$(git log "${ANCHOR}..origin/main" --oneline) | ||
| else | ||
| # Fallback when the tree match isn't in recent history (e.g., first ever promotion). | ||
| LIST=$(git diff --name-status origin/lts origin/main) |
castrojo
added a commit
that referenced
this pull request
Mar 17, 2026
## Commits pending promotion to `lts` a764cfc fix(ci): use tree-hash anchor for accurate promotion commit list (#1197) 6462f99 ci(promote): replace push-based promotion with PR gate (#1195) dd4152f chore(deps): update quay.io/centos-bootc/centos-bootc:c10s docker digest to 7b1e3d1 (#1194) 1658526 chore(deps): update system_files/usr/share/gnome-shell/extensions/search-light@icedman.github.com digest to 4e93e0e (#1193) aa14da4 chore(deps): update quay.io/centos-bootc/centos-bootc:c10s docker digest to b10c380 (#1191) 1ff0c7e Revert "feat(GNOME) : gnome 49 backport" (#1192) 18bb989 chore(deps): update quay.io/centos-bootc/centos-bootc:c10s docker digest to ff6f31c (#1185) 24765e4 feat(GNOME) : gnome 49 backport (#1187) bc65f2a chore(deps): update system_files/usr/share/gnome-shell/extensions/search-light@icedman.github.com digest to e4ad180 (#1190) 914432d chore(deps): update ghcr.io/ublue-os/brew:latest docker digest to fef8b47 (#1189) 1339bc4 chore(deps): update cgr.dev/chainguard/wolfi-base:latest docker digest to 2a43204 (#1188) 4e13431 chore(deps): update ghcr.io/projectbluefin/common:latest docker digest to 9409d0c (#1186) 6a0ad87 chore(deps): update cgr.dev/chainguard/wolfi-base:latest docker digest to a9a3a0c (#1184) 8e1c75f chore(deps): update ghcr.io/projectbluefin/common:latest docker digest to 69e0d5c (#1174) 90132e8 chore(deps): update cgr.dev/chainguard/wolfi-base:latest docker digest to 08420c1 (#1181) b23f809 chore(deps): update actions/download-artifact digest to 3e5f45b (#1183) 13f9b46 chore(deps): update quay.io/centos-bootc/centos-bootc:c10s docker digest to c2dba5f (#1182) 7316e19 chore(deps): update cgr.dev/chainguard/wolfi-base:latest docker digest to 00f9662 (#1156) --- _Squash-merge this PR to promote. The PR body updates automatically as `main` advances._ --------- Co-authored-by: ubot-7274[bot] <217212047+ubot-7274[bot]@users.noreply.github.com> Co-authored-by: James Reilly <jreilly1821@gmail.com> Co-authored-by: Jorge O. Castro <jorge.castro@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
... and of course I messed it up, one more. :)
Solution
Find the most-recent commit on
mainwhose tree hash matches the currentltstree. Since squash-merges preserve content exactly, this is always themaincommit that was squash-merged intolts.git logis anchored from that point, showing only genuinely new commits regardless of squash-merge history.If no match is found within 500 commits (first-ever promotion), falls back to
git diff --name-status.Also fixed
|| truefromgh pr edit— failures now surface visibly instead of silently leaving the PR body stalegit diffdetects a difference butorigin/lts..origin/mainis empty (lts is ahead/diverged), skip rather than open a misleading empty PRAddresses Copilot review comments from #1195.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com
Assisted-by: Claude Sonnet 4.6 via GitHub Copilot